package com.zkthink.zhl.order.dao;



import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zkthink.base.mapper.SuperMapper;

import com.zkthink.clh.order.dto.ChlConfigPageDTO;
import com.zkthink.clh.order.dto.ParameterTypeDto;
import com.zkthink.clh.order.entity.AppletVip;
import com.zkthink.clh.order.entity.ChlConfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 功能价格设置表
 * </p>
 *
 * @author chenke
 * @date 2022-04-24
 */
@Repository
public interface ChlConfigMapper extends SuperMapper<ChlConfig> {
    ChlConfig selectByFunctionType(Integer functionType);
    IPage<ChlConfig> findAdminConfig(IPage page, @Param("dto") ChlConfigPageDTO model);
    @Select("select * from chl_config where parameter_unique = #{parameterUnique} and parameter_type =0")
    ChlConfig findByparameterUnique(String parameterUnique);
   @Update("update chl_config set parameter_type = #{dto.parameterType} where id  = #{dto.id}")
    int parameterType(@Param("dto")ParameterTypeDto dto);

   @Select("select * from applet_vip")
    AppletVip findByVip();

    @Select("select * from applet_vip where id = #{id}")
    AppletVip findVipById(String id);

}
